]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
user-menu: Hide "Switch user" on single user machines
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 18 Oct 2011 18:57:24 +0000 (20:57 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 21 Oct 2011 20:41:04 +0000 (22:41 +0200)
Ignoring remote logins, the "Switch user" action is meaningless for
single user setups. Do not show it in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=657011

js/ui/userMenu.js

index 0e370b634d3c2d60a7755070c6d27e4e374ab92f..f7a680155b3bd3e2d488c0f07c3762c875b3dd33 100644 (file)
@@ -474,6 +474,8 @@ UserMenuButton.prototype = {
         this._createSubMenu();
         this._userManager.connect('notify::is-loaded',
                                   Lang.bind(this, this._updateSwitchUser));
+        this._userManager.connect('notify::has-multiple-users',
+                                  Lang.bind(this, this._updateSwitchUser));
         this._userManager.connect('user-added',
                                   Lang.bind(this, this._updateSwitchUser));
         this._userManager.connect('user-removed',
@@ -518,7 +520,9 @@ UserMenuButton.prototype = {
 
     _updateSwitchUser: function() {
         let allowSwitch = !this._lockdownSettings.get_boolean(DISABLE_USER_SWITCH_KEY);
-        if (allowSwitch && this._userManager.can_switch ())
+        if (allowSwitch &&
+            this._userManager.can_switch() &&
+            this._userManager.has_multiple_users)
             this._loginScreenItem.actor.show();
         else
             this._loginScreenItem.actor.hide();